cmake_minimum_required(VERSION 3.10)
enable_language(C ASM)
project (OS_KERNEL)



aux_source_directory(./kernel DIR_SRCS)

add_executable(kernel.elf ${DIR_SRCS})

set(CMAKE_C_COMPILER "riscv64-unknown-elf-gcc")
add_compile_options(-mcmodel=medany)

set(CMAKE_EXE_LINKER_FLAGS " ${CMAKE_EXE_LINKER_FLAGS} -T ${PROJECT_SOURCE_DIR}/linker/qemu_test.ld ")
set(CMAKE_LINKER "riscv64-unknown-elf-ld")
set(CMAKE_ASM_FLAGS " -mcmodel=medany ")

set(CMAKE_BUILD_TYPE " Debug ")
set(CMAKE_C_FLAGS_DEBUG " $ENV{CFLAGS} -O0 -Wall -g2 -ggdb ")
set(CMAKE_C_FLAGS_RELEAE " $ENV{CFLAGS} -O3 -Wall ")